/**
  ETFAna project, Anyang Normal University && IMP-CAS

  \class ETFVMERawEvent
  \brief class to hold the raw data of a VME event, keeping its original data
  arrangement as in the VME crate. Note that this is a abstract base class
  \author SUN Yazhou, asia.rabbit
  \since 2021-10-06
  \date 2022-04-27
  \attention
  changelog
  <table>
  <tr>  <th>Date         <th>Author      <th>Description                   </tr>
  <tr>  <td>2021-10-06   <td>Asia Sun    <td>file created                  </tr>
  </table>

  \copyright Copyright (c) 2021-2024 Anyang Normal U. && IMP-CAS with LGPLv3 LICENSE
*/

#ifndef ETFVMERawEvent_h
#define ETFVMERawEvent_h

#include <vector>
#include <array>
#include <Rtypes.h>

using std::vector;
using std::array;

class ETFVMERawEvent{
public:
  ETFVMERawEvent(int id = -1);
  ETFVMERawEvent(const ETFVMERawEvent &evt);
  virtual ~ETFVMERawEvent();

  virtual void Reset();
  virtual void Initialize(){ Reset(); }

  const vector<array<double, 32> *> &adc() const{ return fADC; }
  vector<array<double, 32> *> &adc(){ return fADC; }
  const vector<array<double, 32> *> &qdc() const{ return fQDC; }
  vector<array<double, 32> *> &qdc(){ return fQDC; }
  /// subscript version ///
  double adc(int i, int j) const;
  double qdc(int i, int j) const;

  void AddADC();
  void AddQDC();

  virtual void Print() const;
  int id() const{ return fId; }

  ClassDef(ETFVMERawEvent, 1); // original VME daq data format

protected:
  int fId; ///< the id of the unpacker this object belongs to
  vector<array<double, 32> *> fADC; //->
  vector<array<double, 32> *> fQDC; //->
};

#endif
